<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/itemviews/qlistwidget.cpp -->
<head>
  <title>Qt 4.3: QListWidgetItem Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QListWidgetItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QListWidgetItem class provides an item for use with the <a href="qlistwidget.html">QListWidget</a> item view class. <a href="#details">More...</a></p>
<pre> #include &lt;QListWidgetItem&gt;</pre><ul>
<li><a href="qlistwidgetitem-members.html">List of all members, including inherited members</a></li>
<li><a href="qlistwidgetitem-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qlistwidgetitem.html#ItemType-enum">ItemType</a></b> { Type, UserType }</li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qlistwidgetitem.html#QListWidgetItem">QListWidgetItem</a></b> ( QListWidget * <i>parent</i> = 0, int <i>type</i> = Type )</li>
<li><div class="fn"/><b><a href="qlistwidgetitem.html#QListWidgetItem-2">QListWidgetItem</a></b> ( const QString &amp; <i>text</i>, QListWidget * <i>parent</i> = 0, int <i>type</i> = Type )</li>
<li><div class="fn"/><b><a href="qlistwidgetitem.html#QListWidgetItem-3">QListWidgetItem</a></b> ( const QIcon &amp; <i>icon</i>, const QString &amp; <i>text</i>, QListWidget * <i>parent</i> = 0, int <i>type</i> = Type )</li>
<li><div class="fn"/><b><a href="qlistwidgetitem.html#QListWidgetItem-4">QListWidgetItem</a></b> ( const QListWidgetItem &amp; <i>other</i> )</li>
<li><div class="fn"/>virtual <b><a href="qlistwidgetitem.html#dtor.QListWidgetItem">~QListWidgetItem</a></b> ()</li>
<li><div class="fn"/>QBrush <b><a href="qlistwidgetitem.html#background">background</a></b> () const</li>
<li><div class="fn"/>Qt::CheckState <b><a href="qlistwidgetitem.html#checkState">checkState</a></b> () const</li>
<li><div class="fn"/>virtual QListWidgetItem * <b><a href="qlistwidgetitem.html#clone">clone</a></b> () const</li>
<li><div class="fn"/>virtual QVariant <b><a href="qlistwidgetitem.html#data">data</a></b> ( int <i>role</i> ) const</li>
<li><div class="fn"/>Qt::ItemFlags <b><a href="qlistwidgetitem.html#flags">flags</a></b> () const</li>
<li><div class="fn"/>QFont <b><a href="qlistwidgetitem.html#font">font</a></b> () const</li>
<li><div class="fn"/>QBrush <b><a href="qlistwidgetitem.html#foreground">foreground</a></b> () const</li>
<li><div class="fn"/>QIcon <b><a href="qlistwidgetitem.html#icon">icon</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qlistwidgetitem.html#isHidden">isHidden</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qlistwidgetitem.html#isSelected">isSelected</a></b> () const</li>
<li><div class="fn"/>QListWidget * <b><a href="qlistwidgetitem.html#listWidget">listWidget</a></b> () const</li>
<li><div class="fn"/>virtual void <b><a href="qlistwidgetitem.html#read">read</a></b> ( QDataStream &amp; <i>in</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setBackground">setBackground</a></b> ( const QBrush &amp; <i>brush</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setCheckState">setCheckState</a></b> ( Qt::CheckState <i>state</i> )</li>
<li><div class="fn"/>virtual void <b><a href="qlistwidgetitem.html#setData">setData</a></b> ( int <i>role</i>, const QVariant &amp; <i>value</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setFlags">setFlags</a></b> ( Qt::ItemFlags <i>flags</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setFont">setFont</a></b> ( const QFont &amp; <i>font</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setForeground">setForeground</a></b> ( const QBrush &amp; <i>brush</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setHidden">setHidden</a></b> ( bool <i>hide</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setIcon">setIcon</a></b> ( const QIcon &amp; <i>icon</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setSelected">setSelected</a></b> ( bool <i>select</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setSizeHint">setSizeHint</a></b> ( const QSize &amp; <i>size</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a></b> ( const QString &amp; <i>statusTip</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setText">setText</a></b> ( const QString &amp; <i>text</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setTextAlignment">setTextAlignment</a></b> ( int <i>alignment</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setToolTip">setToolTip</a></b> ( const QString &amp; <i>toolTip</i> )</li>
<li><div class="fn"/>void <b><a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a></b> ( const QString &amp; <i>whatsThis</i> )</li>
<li><div class="fn"/>QSize <b><a href="qlistwidgetitem.html#sizeHint">sizeHint</a></b> () const</li>
<li><div class="fn"/>QString <b><a href="qlistwidgetitem.html#statusTip">statusTip</a></b> () const</li>
<li><div class="fn"/>QString <b><a href="qlistwidgetitem.html#text">text</a></b> () const</li>
<li><div class="fn"/>int <b><a href="qlistwidgetitem.html#textAlignment">textAlignment</a></b> () const</li>
<li><div class="fn"/>QString <b><a href="qlistwidgetitem.html#toolTip">toolTip</a></b> () const</li>
<li><div class="fn"/>int <b><a href="qlistwidgetitem.html#type">type</a></b> () const</li>
<li><div class="fn"/>QString <b><a href="qlistwidgetitem.html#whatsThis">whatsThis</a></b> () const</li>
<li><div class="fn"/>virtual void <b><a href="qlistwidgetitem.html#write">write</a></b> ( QDataStream &amp; <i>out</i> ) const</li>
<li><div class="fn"/>virtual bool <b><a href="qlistwidgetitem.html#operator-lt">operator&lt;</a></b> ( const QListWidgetItem &amp; <i>other</i> ) const</li>
<li><div class="fn"/>QListWidgetItem &amp; <b><a href="qlistwidgetitem.html#operator-eq">operator=</a></b> ( const QListWidgetItem &amp; <i>other</i> )</li>
</ul>
<a name="related-non-members"></a>
<h3>Related Non-Members</h3>
<ul>
<li><div class="fn"/>QDataStream &amp; <b><a href="qlistwidgetitem.html#operator-lt-lt-65">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>out</i>, const QListWidgetItem &amp; <i>item</i> )</li>
<li><div class="fn"/>QDataStream &amp; <b><a href="qlistwidgetitem.html#operator-gt-gt-39">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>in</i>, QListWidgetItem &amp; <i>item</i> )</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QListWidgetItem class provides an item for use with the <a href="qlistwidget.html">QListWidget</a> item view class.</p>
<p>QListWidgetItem is used to represent items in a list provided by the <a href="qlistwidget.html">QListWidget</a> class. Each item can hold several pieces of information, and will display these appropriately.</p>
<p>The item view convenience classes use a classic item-based interface rather than a pure model/view approach. For a more flexible list view widget, consider using the <a href="qlistview.html">QListView</a> class with a standard model.</p>
<p>List items can be automatically inserted into a list when they are constructed by specifying the list widget:</p>
<pre>     new QListWidgetItem(tr(&quot;Hazel&quot;), listWidget);</pre>
<p>They can also be created without a parent widget, and later inserted into a list (see <a href="qlistwidget.html#insertItem">QListWidget::insertItem</a>()).</p>
<p>List items are typically used to display <a href="qlistwidgetitem.html#text">text</a>() and an <a href="qlistwidgetitem.html#icon">icon</a>(). These are set with the <a href="qlistwidgetitem.html#setText">setText</a>() and <a href="qlistwidgetitem.html#setIcon">setIcon</a>() functions. The appearance of the text can be customized with <a href="qlistwidgetitem.html#setFont">setFont</a>(), <a href="qlistwidgetitem.html#setForeground">setForeground</a>(), and <a href="qlistwidgetitem.html#setBackground">setBackground</a>(). Text in list items can be aligned using the <a href="qlistwidgetitem.html#setTextAlignment">setTextAlignment</a>() function. Tooltips, status tips and &quot;What's This?&quot; help can be added to list items with <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>(), <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>().</p>
<p>By default, items are enabled, selectable, checkable, and can be the source of a drag and drop operation. Each item's flags can be changed by calling <a href="qlistwidgetitem.html#setFlags">setFlags</a>() with the appropriate value (see <a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a>). Checkable items can be checked, unchecked and partially checked with the <a href="qlistwidgetitem.html#setCheckState">setCheckState</a>() function. The corresponding <a href="qlistwidgetitem.html#checkState">checkState</a>() function indicates what check state the item currently has.</p>
<p>The <a href="qlistwidgetitem.html#isHidden">isHidden</a>() function can be used to determine whether the item is hidden. Items can be hidden with <a href="qlistwidgetitem.html#setHidden">setHidden</a>().</p>
<a name="subclassing"></a>
<h3>Subclassing</h3>
<p>When subclassing QListWidgetItem to provide custom items, it is possible to define new types for them so that they can be distinguished from standard items. The constructors for subclasses that require this feature need to call the base class constructor with a new type value equal to or greater than <a href="qlistwidgetitem.html#ItemType-enum">UserType</a>.</p>
<p>See also <a href="qlistwidget.html">QListWidget</a>, <a href="model-view-programming.html">Model/View Programming</a>, <a href="qtreewidgetitem.html">QTreeWidgetItem</a>, and <a href="qtablewidgetitem.html">QTableWidgetItem</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="ItemType-enum"></a>enum QListWidgetItem::ItemType</h3>
<p>This enum describes the types that are used to describe list widget items.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QListWidgetItem::Type</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The default type for list widget items.</td></tr>
<tr><td valign="top"><tt>QListWidgetItem::UserType</tt></td><td align="center" valign="top"><tt>1000</tt></td><td valign="top">The minimum value for custom types. Values below UserType are reserved by Qt.</td></tr>
</table></p>
<p>You can define new user types in <a href="qlistwidgetitem.html">QListWidgetItem</a> subclasses to ensure that custom items are treated specially.</p>
<p>See also <a href="qlistwidgetitem.html#type">type</a>().</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QListWidgetItem"></a>QListWidgetItem::QListWidgetItem ( <a href="qlistwidget.html">QListWidget</a> * <i>parent</i> = 0, int <i>type</i> = Type )</h3>
<p>Constructs an empty list widget item of the specified <i>type</i> with the given <i>parent</i>. If the parent is not specified, the item will need to be inserted into a list widget with <a href="qlistwidget.html#insertItem">QListWidget::insertItem</a>().</p>
<p>See also <a href="qlistwidgetitem.html#type">type</a>().</p>
<h3 class="fn"><a name="QListWidgetItem-2"></a>QListWidgetItem::QListWidgetItem ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, <a href="qlistwidget.html">QListWidget</a> * <i>parent</i> = 0, int <i>type</i> = Type )</h3>
<p>Constructs an empty list widget item of the specified <i>type</i> with the given <i>text</i> and <i>parent</i>. If the parent is not specified, the item will need to be inserted into a list widget with <a href="qlistwidget.html#insertItem">QListWidget::insertItem</a>().</p>
<p>See also <a href="qlistwidgetitem.html#type">type</a>().</p>
<h3 class="fn"><a name="QListWidgetItem-3"></a>QListWidgetItem::QListWidgetItem ( const <a href="qicon.html">QIcon</a> &amp; <i>icon</i>, const <a href="qstring.html">QString</a> &amp; <i>text</i>, <a href="qlistwidget.html">QListWidget</a> * <i>parent</i> = 0, int <i>type</i> = Type )</h3>
<p>Constructs an empty list widget item of the specified <i>type</i> with the given <i>icon</i>, <i>text</i> and <i>parent</i>. If the parent is not specified, the item will need to be inserted into a list widget with <a href="qlistwidget.html#insertItem">QListWidget::insertItem</a>().</p>
<p>See also <a href="qlistwidgetitem.html#type">type</a>().</p>
<h3 class="fn"><a name="QListWidgetItem-4"></a>QListWidgetItem::QListWidgetItem ( const QListWidgetItem &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>. Note that <a href="qlistwidgetitem.html#type">type</a>() and <a href="qlistwidgetitem.html#listWidget">listWidget</a>() are not copied.</p>
<p>This function is useful when reimplementing <a href="qlistwidgetitem.html#clone">clone</a>().</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qlistwidgetitem.html#data">data</a>() and <a href="qlistwidgetitem.html#flags">flags</a>().</p>
<h3 class="fn"><a name="dtor.QListWidgetItem"></a>QListWidgetItem::~QListWidgetItem ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys the list item.</p>
<h3 class="fn"><a name="background"></a><a href="qbrush.html">QBrush</a> QListWidgetItem::background () const</h3>
<p>Returns the brush used to display the list item's background.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#setBackground">setBackground</a>() and <a href="qlistwidgetitem.html#foreground">foreground</a>().</p>
<h3 class="fn"><a name="checkState"></a><a href="qt.html#CheckState-enum">Qt::CheckState</a> QListWidgetItem::checkState () const</h3>
<p>Returns the checked state of the list item (see <a href="qt.html#CheckState-enum">Qt::CheckState</a>).</p>
<p>See also <a href="qlistwidgetitem.html#setCheckState">setCheckState</a>() and <a href="qlistwidgetitem.html#flags">flags</a>().</p>
<h3 class="fn"><a name="clone"></a>QListWidgetItem * QListWidgetItem::clone () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Creates an exact copy of the item.</p>
<h3 class="fn"><a name="data"></a><a href="qvariant.html">QVariant</a> QListWidgetItem::data ( int <i>role</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This function returns the item's data for a given <i>role</i> (see <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>). Reimplement this function if you need extra roles or special behavior for certain roles.</p>
<p>See also <a href="qlistwidgetitem.html#setData">setData</a>().</p>
<h3 class="fn"><a name="flags"></a><a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a> QListWidgetItem::flags () const</h3>
<p>Returns the item flags for this item (see <a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a>).</p>
<p>See also <a href="qlistwidgetitem.html#setFlags">setFlags</a>().</p>
<h3 class="fn"><a name="font"></a><a href="qfont.html">QFont</a> QListWidgetItem::font () const</h3>
<p>Returns the font used to display this list item's text.</p>
<p>See also <a href="qlistwidgetitem.html#setFont">setFont</a>().</p>
<h3 class="fn"><a name="foreground"></a><a href="qbrush.html">QBrush</a> QListWidgetItem::foreground () const</h3>
<p>Returns the brush used to display the list item's foreground (e.g&#x2e; text).</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#setForeground">setForeground</a>() and <a href="qlistwidgetitem.html#background">background</a>().</p>
<h3 class="fn"><a name="icon"></a><a href="qicon.html">QIcon</a> QListWidgetItem::icon () const</h3>
<p>Returns the list item's icon.</p>
<p>See also <a href="qlistwidgetitem.html#setIcon">setIcon</a>() and <a href="qabstractitemview.html#iconSize-prop">iconSize</a>.</p>
<h3 class="fn"><a name="isHidden"></a>bool QListWidgetItem::isHidden () const</h3>
<p>Returns true if the item is hidden, otherwise returns false.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#setHidden">setHidden</a>().</p>
<h3 class="fn"><a name="isSelected"></a>bool QListWidgetItem::isSelected () const</h3>
<p>Returns true if the item is selected, otherwise returns false.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#setSelected">setSelected</a>().</p>
<h3 class="fn"><a name="listWidget"></a><a href="qlistwidget.html">QListWidget</a> * QListWidgetItem::listWidget () const</h3>
<p>Returns the list widget that contains the item.</p>
<h3 class="fn"><a name="read"></a>void QListWidgetItem::read ( <a href="qdatastream.html">QDataStream</a> &amp; <i>in</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reads the item from stream <i>in</i>.</p>
<p>See also <a href="qlistwidgetitem.html#write">write</a>().</p>
<h3 class="fn"><a name="setBackground"></a>void QListWidgetItem::setBackground ( const <a href="qbrush.html">QBrush</a> &amp; <i>brush</i> )</h3>
<p>Sets the background brush of the list item to the given <i>brush</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#background">background</a>() and <a href="qlistwidgetitem.html#setForeground">setForeground</a>().</p>
<h3 class="fn"><a name="setCheckState"></a>void QListWidgetItem::setCheckState ( <a href="qt.html#CheckState-enum">Qt::CheckState</a> <i>state</i> )</h3>
<p>Sets the check state of the list item to <i>state</i>.</p>
<p>See also <a href="qlistwidgetitem.html#checkState">checkState</a>().</p>
<h3 class="fn"><a name="setData"></a>void QListWidgetItem::setData ( int <i>role</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This function sets the data for a given <i>role</i> to the given <i>value</i> (see <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a>). Reimplement this function if you need extra roles or special behavior for certain roles.</p>
<p>See also <a href="qt.html#ItemDataRole-enum">Qt::ItemDataRole</a> and <a href="qlistwidgetitem.html#data">data</a>().</p>
<h3 class="fn"><a name="setFlags"></a>void QListWidgetItem::setFlags ( <a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a> <i>flags</i> )</h3>
<p>Sets the item flags for the list item to <i>flags</i> (see <a href="qt.html#ItemFlag-enum">Qt::ItemFlags</a>).</p>
<p>See also <a href="qlistwidgetitem.html#flags">flags</a>().</p>
<h3 class="fn"><a name="setFont"></a>void QListWidgetItem::setFont ( const <a href="qfont.html">QFont</a> &amp; <i>font</i> )</h3>
<p>Sets the font used when painting the item to the given <i>font</i>.</p>
<p>See also <a href="qlistwidgetitem.html#font">font</a>().</p>
<h3 class="fn"><a name="setForeground"></a>void QListWidgetItem::setForeground ( const <a href="qbrush.html">QBrush</a> &amp; <i>brush</i> )</h3>
<p>Sets the foreground brush of the list item to the given <i>brush</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#foreground">foreground</a>() and <a href="qlistwidgetitem.html#setBackground">setBackground</a>().</p>
<h3 class="fn"><a name="setHidden"></a>void QListWidgetItem::setHidden ( bool <i>hide</i> )</h3>
<p>Hides the item if <i>hide</i> is true, otherwise shows the item.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#isHidden">isHidden</a>().</p>
<h3 class="fn"><a name="setIcon"></a>void QListWidgetItem::setIcon ( const <a href="qicon.html">QIcon</a> &amp; <i>icon</i> )</h3>
<p>Sets the icon for the list item to the given <i>icon</i>.</p>
<p>See also <a href="qlistwidgetitem.html#icon">icon</a>(), <a href="qlistwidgetitem.html#text">text</a>(), and <a href="qabstractitemview.html#iconSize-prop">iconSize</a>.</p>
<h3 class="fn"><a name="setSelected"></a>void QListWidgetItem::setSelected ( bool <i>select</i> )</h3>
<p>Sets the selected state of the item to <i>select</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qlistwidgetitem.html#isSelected">isSelected</a>().</p>
<h3 class="fn"><a name="setSizeHint"></a>void QListWidgetItem::setSizeHint ( const <a href="qsize.html">QSize</a> &amp; <i>size</i> )</h3>
<p>Sets the size hint for the list item to be <i>size</i>. If no size hint is set, the item delegate will compute the size hint based on the item data.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qlistwidgetitem.html#sizeHint">sizeHint</a>().</p>
<h3 class="fn"><a name="setStatusTip"></a>void QListWidgetItem::setStatusTip ( const <a href="qstring.html">QString</a> &amp; <i>statusTip</i> )</h3>
<p>Sets the status tip for the list item to the text specified by <i>statusTip</i>.</p>
<p>See also <a href="qlistwidgetitem.html#statusTip">statusTip</a>(), <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>(), and <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>().</p>
<h3 class="fn"><a name="setText"></a>void QListWidgetItem::setText ( const <a href="qstring.html">QString</a> &amp; <i>text</i> )</h3>
<p>Sets the text for the list widget item's to the given <i>text</i>.</p>
<p>See also <a href="qlistwidgetitem.html#text">text</a>().</p>
<h3 class="fn"><a name="setTextAlignment"></a>void QListWidgetItem::setTextAlignment ( int <i>alignment</i> )</h3>
<p>Sets the list item's text alignment to <i>alignment</i> (see <a href="qt.html#AlignmentFlag-enum">Qt::AlignmentFlag</a>).</p>
<p>See also <a href="qlistwidgetitem.html#textAlignment">textAlignment</a>().</p>
<h3 class="fn"><a name="setToolTip"></a>void QListWidgetItem::setToolTip ( const <a href="qstring.html">QString</a> &amp; <i>toolTip</i> )</h3>
<p>Sets the tooltip for the list item to the text specified by <i>toolTip</i>.</p>
<p>See also <a href="qlistwidgetitem.html#toolTip">toolTip</a>(), <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>().</p>
<h3 class="fn"><a name="setWhatsThis"></a>void QListWidgetItem::setWhatsThis ( const <a href="qstring.html">QString</a> &amp; <i>whatsThis</i> )</h3>
<p>Sets the &quot;What's This?&quot; help for the list item to the text specified by <i>whatsThis</i>.</p>
<p>See also <a href="qlistwidgetitem.html#whatsThis">whatsThis</a>(), <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>().</p>
<h3 class="fn"><a name="sizeHint"></a><a href="qsize.html">QSize</a> QListWidgetItem::sizeHint () const</h3>
<p>Returns the size hint set for the list item.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qlistwidgetitem.html#setSizeHint">setSizeHint</a>().</p>
<h3 class="fn"><a name="statusTip"></a><a href="qstring.html">QString</a> QListWidgetItem::statusTip () const</h3>
<p>Returns the list item's status tip.</p>
<p>See also <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>().</p>
<h3 class="fn"><a name="text"></a><a href="qstring.html">QString</a> QListWidgetItem::text () const</h3>
<p>Returns the list item's text.</p>
<p>See also <a href="qlistwidgetitem.html#setText">setText</a>().</p>
<h3 class="fn"><a name="textAlignment"></a>int QListWidgetItem::textAlignment () const</h3>
<p>Returns the text alignment for the list item (see <a href="qt.html#AlignmentFlag-enum">Qt::AlignmentFlag</a>).</p>
<p>See also <a href="qlistwidgetitem.html#setTextAlignment">setTextAlignment</a>().</p>
<h3 class="fn"><a name="toolTip"></a><a href="qstring.html">QString</a> QListWidgetItem::toolTip () const</h3>
<p>Returns the list item's tooltip.</p>
<p>See also <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>(), <a href="qlistwidgetitem.html#statusTip">statusTip</a>(), and <a href="qlistwidgetitem.html#whatsThis">whatsThis</a>().</p>
<h3 class="fn"><a name="type"></a>int QListWidgetItem::type () const</h3>
<p>Returns the type passed to the <a href="qlistwidgetitem.html">QListWidgetItem</a> constructor.</p>
<h3 class="fn"><a name="whatsThis"></a><a href="qstring.html">QString</a> QListWidgetItem::whatsThis () const</h3>
<p>Returns the list item's &quot;What's This?&quot; help text.</p>
<p>See also <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>(), <a href="qlistwidgetitem.html#statusTip">statusTip</a>(), and <a href="qlistwidgetitem.html#toolTip">toolTip</a>().</p>
<h3 class="fn"><a name="write"></a>void QListWidgetItem::write ( <a href="qdatastream.html">QDataStream</a> &amp; <i>out</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Writes the item to stream <i>out</i>.</p>
<p>See also <a href="qlistwidgetitem.html#read">read</a>().</p>
<h3 class="fn"><a name="operator-lt"></a>bool QListWidgetItem::operator&lt; ( const QListWidgetItem &amp; <i>other</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns true if this item's text is less then <i>other</i> item's text; otherwise returns false.</p>
<h3 class="fn"><a name="operator-eq"></a>QListWidgetItem &amp; QListWidgetItem::operator= ( const QListWidgetItem &amp; <i>other</i> )</h3>
<p>Assigns <i>other</i>'s data and flags to this item. Note that <a href="qlistwidgetitem.html#type">type</a>() and <a href="qlistwidgetitem.html#listWidget">listWidget</a>() are not copied.</p>
<p>This function is useful when reimplementing <a href="qlistwidgetitem.html#clone">clone</a>().</p>
<p>See also <a href="qlistwidgetitem.html#data">data</a>() and <a href="qlistwidgetitem.html#flags">flags</a>().</p>
<hr />
<h2>Related Non-Members</h2>
<h3 class="fn"><a name="operator-lt-lt-65"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&lt;&lt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>out</i>, const QListWidgetItem &amp; <i>item</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Writes the list widget item <i>item</i> to stream <i>out</i>.</p>
<p>This operator uses <a href="qlistwidgetitem.html#write">QListWidgetItem::write</a>().</p>
<p>See also <a href="datastreamformat.html">Format of the QDataStream Operators</a>.</p>
<h3 class="fn"><a name="operator-gt-gt-39"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&gt;&gt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>in</i>, QListWidgetItem &amp; <i>item</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Reads a list widget item from stream <i>in</i> into <i>item</i>.</p>
<p>This operator uses <a href="qlistwidgetitem.html#read">QListWidgetItem::read</a>().</p>
<p>See also <a href="datastreamformat.html">Format of the QDataStream Operators</a>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
